<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人就业情况</title>
<base href="<%=basePath%>">
<!-- start: CSS -->
<link id="bootstrap-style" href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link id="base-style" href="css/style.css" rel="stylesheet">
<link id="base-style-responsive" href="css/style-responsive.css"
	rel="stylesheet">
<!-- end: CSS -->
<!-- start: JavaScript-->

<script src="js/jquery-2.2.4.min.js"></script>

<script src="js/jquery-migrate-1.0.0.min.js"></script>

<script src="js/jquery-ui-1.10.0.custom.min.js"></script>

<script src="js/jquery.ui.touch-punch.js"></script>

<script src="js/modernizr.js"></script>

<script src="js/bootstrap.min.js"></script>

<script src="js/jquery.cookie.js"></script>

<script src='js/fullcalendar.min.js'></script>

<script src='js/jquery.dataTables.min.js'></script>

<script src="js/excanvas.js"></script>
<script src="js/jquery.flot.js"></script>
<script src="js/jquery.flot.pie.js"></script>
<script src="js/jquery.flot.stack.js"></script>
<script src="js/jquery.flot.resize.min.js"></script>

<script src="js/jquery.chosen.min.js"></script>

<script src="js/jquery.uniform.min.js"></script>

<script src="js/jquery.cleditor.min.js"></script>

<script src="js/jquery.noty.js"></script>

<script src="js/jquery.elfinder.min.js"></script>

<script src="js/jquery.raty.min.js"></script>

<script src="js/jquery.iphone.toggle.js"></script>

<script src="js/jquery.uploadify-3.1.min.js"></script>

<script src="js/jquery.gritter.min.js"></script>

<script src="js/jquery.imagesloaded.js"></script>

<script src="js/jquery.masonry.min.js"></script>

<script src="js/jquery.knob.modified.js"></script>

<script src="js/jquery.sparkline.min.js"></script>

<script src="js/counter.js"></script>

<script src="js/retina.js"></script>

<script src="js/custom.js"></script>
<script src="js/echarts.min.js"></script>
<script src="page/pagetool.js"></script>
<!-- end: JavaScript-->


<script type="text/javascript">
	var pageNumA = 1;//第一个列表
	var pageNumB = 1;

	function search(pageNumA) { //根据姓名模糊查询
		var stuname = $("#findname").val();
		if (stuname == ""){
			alert("请输入姓名");
			return;
		}
		$.ajax({
			url : "TestServlet",
			type : "post",
			dataType : "json",
			data : {"name" : stuname,"pageNum":pageNumA},
			success : function(data) {
				var num = 1;
				pageNumA = setPage(pageNumA, 1, "search()");
				$(".stulist").remove();
				$.each(data, function(index, info) {
					var stuin = $(".template").clone();
					stuin.attr("id", num + "f");
					stuin.addClass("stulist");
					stuin.removeAttr("style");
					stuin.removeClass("template");
					stuin.find("#name").text("姓名");
					stuin.find("#class").text(info.classid);
					stuin.find("#sex").text(info.sex);
					stuin.find("#school").text(info.schname);
					stuin.find("#major").text(info.major);
					stuin.find("#tel").text(info.tel);
					stuin.find("#addr").text(info.address);
					stuin.find("#find").val(info.stuid);
					$("#" + (num-1)+ "f").after(stuin);
					//$(".template").after(stuin);
					num++;

				})
			}

		})
	}
	function datainfo(datainfo) {
		$("#studata").removeAttr("style");
		//$("#studata").show();
		$("#data1").text("40%");
		$("#data2").text("50%");
		$("#data3").text("60%");
	}

	function stujobinfo(stuid) { //查看学生详情
		if (stuid == "")
			return;
		$.ajax({
			url : "TestServlet2",
			type : "post",
			dataType : "json",
			data : {"stuid" : stuid},
			success : function(data) {
				var num = 0;
				$(".stujob").remove();
				$.each(data, function(index, info) {

					var jobin = $(".jobtemplate").clone();
					jobin.removeClass("jobtemplate");
					jobin.removeAttr("style");
					jobin.addClass("stujob");
					jobin.attr("id", "job" + (num + 1) + "f");
					jobin.find("#comp").text(info.entername);
					jobin.find("#job").text(info.jobname);
					jobin.find("#state1").text(info.istate);
					jobin.find("#state2").text(info.wstate);
					jobin.find("#state3").text(info.offer);
					$("#job" + num + "f").after(jobin);
					//$(".jobtemplate").after(jobin);
				num++;

				})
				datainfo(datainfo);

			}

		})
	}
	
	function keydown(){
		if (event.keyCode == 13)
			search();
	}
	

	$(function() {
		pageNumA = setPage(pageNumA, 1, "");
		//pageNumB = setPage(pageNumB, 1, "");
	})
</script>
</head>
<body>


	<div class="container-fluid-full">
		<div class="row-fluid">
			<!-- start: Header -->
			<jsp:include page="header.jsp"></jsp:include>
			<!-- start: Header -->

			<jsp:include page="sidebar.jsp"></jsp:include>

			<!-- start: Content -->
			<!-- start: 主体 -->
			<div id="content" class="span10">
				<ul class="breadcrumb">
					<li><i class="icon-home"></i> <a href="index.jsp">Home</a> <i
						class="icon-angle-right"></i></li>
					<li>个人就业查询</li>
				</ul>


				<div class="row-fluid hideInIE8 circleStats">
					<!--start写在这里-->


					<div class="row-fluid">
						<div class="box span12">
							<div class="box-header" data-original-title>
								<h2>
									<i class="halflings-icon white user"></i><span class="break"></span>个人就业情况
								</h2>
							</div>
							<div class="box-content">
								<div align="right">
									<input type="text" id="findname" placeholder="请输入姓名" onkeydown="keydown()" />
									<button class="btn btn-success" onclick="search()">搜索</button>
								</div>
								<table
									class="table table-striped table-bordered bootstrap-datatable">
									<thead>
										<tr>
											<th>姓名</th>
											<th>班级</th>
											<th>性别</th>
											<th>学校</th>
											<th>专业</th>
											<th>联系方式</th>
											<th>住址</th>
											<th>查询</th>
										</tr>
									</thead>
									<tbody>
										<tr class="template" id="0f" style="display: none;">
											<td id="name">姓名</td>
											<td class="center" id="class">班级</td>
											<td class="center" id="sex">性别</td>
											<td class="center" id="school">学校</td>
											<td class="center" id="major">专业</td>
											<td class="center" id="tel">联系方式</td>
											<td class="center" id="addr">住址</td>
											<td class="center"><button id="find"
													class="btn btn-success find" onclick="stujobinfo(this.value)">
													<i class="halflings-icon white zoom-in"></i>
												</button></td>
										</tr>
										<!-- 此处追加学生信息 -->

									</tbody>
								</table>
								<jsp:include page="page/pagetool.jsp"></jsp:include>
							</div>
						</div>
						<!--/span-->

					</div>
					<!--/row-->


					<div class="row-fluid">
						<div class="box span6">
							<div class="box-header">
								<h2>
									<i class="halflings-icon white align-justify"></i><span
										class="break"></span>就业信息
								</h2>
								<div class="box-icon"></div>
							</div>
							<div class="box-content">
								<table class="table">
									<thead>
										<tr>
											<th>公司名称</th>
											<th>岗位名称</th>
											<th>笔试情况</th>
											<th>面试情况</th>
											<th>offer情况</th>
										</tr>
									</thead>
									<tbody>
										<tr class="jobtemplate" id="job0f" style="display: none;">
											<td id="comp">南京烽火</td>
											<td class="center" id="job">Java研发</td>
											<td class="center" id="state1">通过</td>
											<td class="center" id="state2">通过</td>
											<td class="center" id="state3">通过</td>
											<!-- <span class="label label-success" id="state3">获得</span> -->

										</tr>

									</tbody>
								</table>
								<jsp:include page="page/pagetool.jsp"></jsp:include>
							</div>
						</div>
						<!--/span-->

						<div class="box span6">
							<div class="box-header">
								<h2>
									<i class="halflings-icon white align-justify"></i><span
										class="break"></span>数据汇总
								</h2>
								<div class="box-icon"></div>
							</div>
							<div class="box-content">
								<table class="table table-striped">
									<thead>
										<tr>
											<th>笔试通过率</th>
											<th>面试通过率</th>
											<th>offer率</th>
										</tr>
									</thead>
									<tbody>
										<tr id="studata" style="display: none;">
											<td class="center" id="data1">null</td>
											<td class="center" id="data2">null</td>
											<td class="center" id="data3">null</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<!--/span-->
					</div>
					<!--/row-->









				</div>

			</div>

			<!-- end: Content -->
			<!-- end: 主体结束 -->
		</div>
		<!--/#content.span10-->
	</div>
	<!--/fluid-row-->
	<jsp:include page="footer.jsp"></jsp:include>

</body>
</html>